package com.dwxt.community.admin.service;

import com.dwxt.community.dao.IntegralRecordMapper;
import com.dwxt.community.entity.IntegralRecord;
import com.dwxt.community.entity.IntegralRecordExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class IntegralRecordServiceAdmin {
    @Autowired
    private IntegralRecordMapper integralRecordMapper;

    public Integer sumTrash(String id) {
        return integralRecordMapper.sum(id);
    }

    public Long countTrash(String id) {
        IntegralRecordExample example=new IntegralRecordExample();
        example.createCriteria().andUserIdEqualTo(id).andCategoryEqualTo("垃圾分类");
        return integralRecordMapper.countByExample(example);
    }
}
